import {userInfo} from "@/api/user/types.ts";
import {MenuList} from "@/api/menu/type.ts";
import {TreeKey} from "element-plus/es/components/tree-v2/src/types";

export interface RoleListData {
    code: number
    data: {
        roleList: Role[];
        total: number;
        menuList: MenuList[];
    }
    msg: string
}

export interface Role {
    ID: number;
    CreatedAt: string;
    UpdatedAt: string;
    DeletedAt: null | string;
    name: string;
    describe: string;
    modifier: userInfo;
    creator: userInfo;
    Menus: null | MenuList[];
    isUsable: number;
}

export interface RequestData {
    name: string;
    isUsable: number | null;
    currentPage: number;
    pageSize: number;
}

export interface RoleData {
    code: number;
    data: Role;
    msg: string;
}

export interface reqRoleData {
    ID: number;
    name: string;
    describe: string;
    isUsable: number;
    menuIDs: TreeKey[];
}

export interface reqAddRoleData {
    name: string;
    describe: string;
    isUsable: number;
    menuIDs: TreeKey[];
}